export function timestampToDate(timestamp: any) {
  let date: any
  if (timestamp.length == 10) {
    date = new Date(parseInt(timestamp) * 1000)
  } else if (timestamp.length == 13) {
    date = new Date(parseInt(timestamp))
  }
  const y = date.getFullYear()
  let m = date.getMonth() + 1
  let d = date.getDate()
  const h = date.getHours()
  let minute = date.getMinutes()
  let second = date.getSeconds()
  m = m < 10 ? '0' + m : m
  d = d < 10 ? '0' + d : d
  minute = minute < 10 ? '0' + minute : minute
  second = second < 10 ? '0' + second : second

  return `${y}-${m}-${d} ${h}:${minute}:${second}`
}
